package com.dwfyc.fachada;

import java.util.List;

import org.apache.log4j.Logger;

import com.dwfyc.hibernate.Rol;
import com.dwfyc.hibernate.Rolsubtarea;
import com.dwfyc.hibernate.RolsubtareaDAO;

public class GestionRolSubtarea implements IGestionRolSubtarea {
	private Logger log = Logger.getLogger(this.getClass());

	private RolsubtareaDAO rolSubtareaDAO;

	public RolsubtareaDAO getRolSubtareaDAO() {
		return rolSubtareaDAO;
	}

	public void setRolSubtareaDAO(RolsubtareaDAO rolSubtareaDAO) {
		this.rolSubtareaDAO = rolSubtareaDAO;
	}

	@Override
	public List<Rolsubtarea> getSubtareasFromRol(Rol r) {
		List<Rolsubtarea> retorno = rolSubtareaDAO.getSubtaresFromRol(r);

		if (retorno == null) {
			log.error("Error en getSubtareasFromRol(Rol r) --> No pudo conseguir las subtareas del rol.");
		}

		return retorno;
	}
}
